#ifndef RANDOM_GEN
#define RANDOM_GEN

#include <random>
#include "type_define.hpp"

template <class T, class RandomEngine, class Distribution> class RandomNumberBetween {
public:
  RandomNumberBetween(T low, T high)
      : random_engine_{std::random_device{}()}, distribution_{low, high} {}

  T operator()() { return distribution_(random_engine_); }

private:
  RandomEngine random_engine_;
  Distribution distribution_;
};

namespace ranges
{
    template<typename Range, typename Generator>
    void generate(Range& range, Generator generator)
    {
        return std::generate(std::begin(range), std::end(range), generator);
    }
}

using mt_uniform_float_rg =
    RandomNumberBetween<f32, std::mt19937, std::uniform_real_distribution<f32>>;
using mt_uniform_int_rg = 
    RandomNumberBetween<i32, std::mt19937, std::uniform_int_distribution<i32>>;
#endif